﻿//using mBlog.Data.Entities;

//namespace mBlog.Services
//{
//    public class SpamCommentService
//    {
//        const string apiKey = "4907e11cd6f8";
//        const string blog = "http://www.fengqijun.com";

//        static Akismet akiService = new Akismet(apiKey, blog, null);

//        /// <summary>
//        /// Check whether a comment is a spam one
//        /// </summary>
//        /// <param name="comment">The comment to check</param>
//        /// <returns>False, if it is a spam</returns>
//        public static bool CheckComment(Comment comment)
//        {
//            AkismetComment comm = new AkismetComment();
//            comm.Blog = "http://www.fengqijun.com";
//            comm.UserIp = comment.Ip;
//            comm.UserAgent = "";
//            comm.CommentContent = comment.Content;
//            comm.CommentType = "blog";
//            comm.CommentAuthor = comment.Author;
//            comm.CommentAuthorEmail = comment.Email;
//            comm.CommentAuthorUrl = comment.Site;

//            try
//            {
//                return akiService.CommentCheck(comm);
//            }
//            catch
//            {
//                return false;
//            }
//        }
//    }
//}